***Replication Code for "Race, Representation, and the Legitimacy of International Organizations"


**Figure 1
*SA 
use "SA_Survey.dta"
ciplot wtomanip_black, by(wtotreat) name(wtomanipbls, replace)
ciplot wtomanip_africa, by(wtotreat) name(wtomanipregs, replace)

*US
use "US_Survey_2021Sep.dta"
ciplot wtomanip_black, by(wtotreat) name(wtomanipblu, replace)
ciplot wtomanip_america, by(wtotreat) name(wtomanipregu, replace)

*create figure
graph combine wtomanipbls wtomanipblu wtomanipregs wtomanipregu, col(2)


**Figure 2
*SA
use "SA_Survey.dta"
ciplot wtoconf if white==0, by(wtotreat) name(sawtob, replace)
ciplot wtoconf if white==1, by(wtotreat) name(sawtow, replace)

*US
use "US_Survey_2021Sep.dta"
ciplot wtoconf if white==0, by(wtotreat) name(uswtob, replace)
ciplot wtoconf if white==1, by(wtotreat) name(uswtow, replace)

*create figure
graph combine sawtob uswtob sawtow  uswtow, col(2) ycommon


**Figure 3
*SA
use "SA_Survey.dta"
regress wtoconf  wtot1 wtot3 wtot4 white wtot1Xwhite wtot3Xwhite wtot4Xwhite
estimates store wtosab
regress wtoconf  wtot1 wtotreat3 wtot4 black wtot1Xblack wtot3Xblack wtot4Xblack
estimates store wtosaw
coefplot wtosaw wtosab, drop(_cons wtot1 wtot4 white wtot1Xwhite wtot4Xwhite black wtot1Xblack wtot3Xblack wtot4Xblack) xline(0) name(sarace, replace) ciopts(lcolor(black)) mcolor(black)

*US
use "US_Survey_2021Sep.dta"
regress wtoconf  wtot1 wtot3 wtot4 white wtot1Xwhite wtot3Xwhite wtot4Xwhite
estimates store wtousb
regress wtoconf  wtot1 wtotreat3 wtot4 black wtot1Xblack wtot3Xblack wtot4Xblack
estimates store wtousw
coefplot wtousw wtousb, drop(_cons wtot1 wtot4 white wtot1Xwhite wtot4Xwhite black wtot1Xblack wtot3Xblack wtot4Xblack) xline(0)  name(usrace, replace)  ciopts(lcolor(black)) mcolor(black)

*combine graphs
graph combine sarace usrace


**Figure 4
*SA WHO Experiment 
use "SA_Survey.dta"
regress whoconf whot2 whot3  white whot2Xwhite whot3Xwhite
estimates store whosab
regress whoconf whotreat2 whot3 black whot2Xblack whot3Xblack 
estimates store whosaw
coefplot whosaw whosab, drop(_cons whot3 white whot3Xwhite black whot2Xblack whot3Xblack) xline(0) name(saracewho, replace) ciopts(lcolor(black)) mcolor(black)

*US WHO Experiment
use "US_Survey_2021Sep.dta"
regress whoconf whot2 whot3  white whot2Xwhite whot3Xwhite
estimates store whousb
regress whoconf whotreat2 whot3 black whot2Xblack whot3Xblack 
estimates store whousw
coefplot whousw whousb, drop(_cons whot3 white whot3Xwhite black whot2Xblack whot3Xblack) xline(0) name(usracewho, replace) ciopts(lcolor(black)) mcolor(black)

*US ILO Experiment
use "US_Survey_2023Feb.dta"
regress iloconf ilot2 ilot3 white ilot2Xwhite ilot3Xwhite
estimates store ilorb
regress iloconf ilotreat2 ilotreat3 black ilot2Xblack ilot3Xblack
estimates store ilorw	
coefplot ilorb ilorw, keep(ilot2 ilotreat2 ilot2Xwhite) order(ilotreat2 ilot2 ilot2Xwhite) xline(0, lcolor(gray)) name(iloracemfx, replace) ciopts(lcolor(black)) mcolor(black)

*US Conjoint Experiment
use "US_conjoint.dta"
reg cj_dv race white raceXwhite i.cj_members i.cj_age i.cj_country  i.cj_staff i.cj_gender, cluster(record)
estimates store cjrb
reg cj_dv racet black raceXblack i.cj_members i.cj_age i.cj_country  i.cj_staff i.cj_gender, cluster(record)
estimates store cjrw
coefplot cjrb cjrw, keep(race racet raceXwhite) order(racet race raceXwhite) xline(0, lcolor(gray)) name(cjracemfx, replace) ciopts(lcolor(black)) mcolor(black)

*combine graphs
graph combine saracewho usracewho iloracemfx cjracemfx


**Figure 5
use "Kenya_Survey.dta"

*WTO
reg wtoconf wtotreat
estimates store kenyawto
coefplot kenyawto, keep(wtotreat) order(wtotreat) xline(0, lcolor(gray)) name(kenyawtomfx, replace) ciopts(lcolor(black)) mcolor(black)

*ILO
reg iloconf ilotreat
estimates store kenyailo
coefplot kenyailo, keep(ilotreat) order(wtotreat) xline(0, lcolor(gray)) name(kenyailomfx, replace) ciopts(lcolor(black)) mcolor(black)

*Conjoint
use "Kenya_conjoint.dta"
reg cj_dv cj_race i.cj_members i.cj_age i.cj_country  i.cj_staff i.cj_gender, cluster(record)
estimates store kenyacj
coefplot kenyacj, keep(cj_race) order(cj_race) xline(0, lcolor(gray))  leg(off)  name(kenyacjmfx, replace) ciopts(lcolor(black)) mcolor(black)

*combine graphs
graph combine kenyawtomfx kenyailomfx kenyacjmfx, xcommon cols(3)
